package org.lex.game.sudoku.model;

public class Point {
	public final int x;
	public final int y;

	public Point(int row, int column) {
		this.x = row;
		this.y = column;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + y;
		result = prime * result + x;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Point other = (Point) obj;
		if (y != other.y)
			return false;
		if (x != other.x)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "(" + x + ", " + y + ")";
	}

	public String viewString() {
		return "(" + (x + 1) + ", " + (y + 1) + ")";
	}
}
